home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / mklib.osf1 < prev    next >
Text File  |  1998-12-15  |  1KB  |  52 lines

  1. #!/bin/sh
  2.  
  3. # Make a digital unix shared library (OSF/1)
  4. # provided by Thomas Graichen (graichen@rzpd.de)
  5.  
  6. #--identification------------------------------------------------------
  7.  
  8. # $Id: mklib.osf1,v 1.8 1998/08/01 03:30:47 brianp Exp $
  9.  
  10. # $Log: mklib.osf1,v $
  11. # Revision 1.8  1998/08/01 03:30:47  brianp
  12. # MAJOR was hardcoded to 2, doh!  Spotted by Randy Frank.
  13. #
  14. # Revision 1.7  1997/10/21 23:32:31  brianp
  15. # now takes major and minor version arguments
  16. #
  17.  
  18. #--common--------------------------------------------------------------
  19.  
  20. # Usage:  mklib libname major minor file.o ...
  21. #
  22. # First argument is name of output library (LIBRARY)
  23. # Second arg is major version number (MAJOR)
  24. # Third arg is minor version number (MINOR)
  25. # Rest of arguments are object files (OBJECTS)
  26.  
  27. LIBRARY=$1
  28. shift 1
  29.  
  30. MAJOR=$1
  31. shift 1
  32.  
  33. MINOR=$1
  34. shift 1
  35.  
  36. OBJECTS=$*
  37.  
  38. #--platform------------------------------------------------------------
  39.  
  40. VERSION="${MAJOR}.${MINOR}"
  41.  
  42. LIBNAME=`basename $LIBRARY`
  43. ARNAME=`basename $LIBNAME .so`.a
  44. DIRNAME=`dirname $LIBRARY`
  45.  
  46. rm -f ${LIBRARY}.${VERSION}
  47. ld -o ${LIBRARY}.${VERSION} -shared -no_archive -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS}
  48. (cd $DIRNAME; ln -sf ${LIBNAME}.${VERSION} ${LIBNAME})
  49.  
  50. rm -f ${DIRNAME}/${ARNAME}
  51. ar clqz ${DIRNAME}/${ARNAME} ${OBJECTS}
  52.